using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Device
{
	public class ModuleType
	{
		public const int _DEVICE = 0;
		public const int _STOCKER = 1;
		public const int _LIFTER = 2;
		public const int _OHS = 3;
		public const int _OHT = 4;
		public const int _AGV = 5;
		public const int _PROCESS = 6;
		private int _value;
		private static int _size;
		private static ModuleType[] _array;
		public static string[] displayStrings;
		public static ModuleType[] displayValues;
		public static ModuleType DEVICE;
		public static ModuleType STOCKER;
		public static ModuleType LIFTER;
		public static ModuleType OHS;
		public static ModuleType OHT;
		public static ModuleType AGV;
		public static ModuleType PROCESS;
		public static ModuleType IT_ENUM_MAX;
		static ModuleType()
		{
			ModuleType._size = 7;
			ModuleType._array = new ModuleType[ModuleType._size];
			ModuleType.displayStrings = new string[ModuleType._size];
			ModuleType.displayValues = new ModuleType[ModuleType._size];
			ModuleType.DEVICE = new ModuleType(0);
			ModuleType.STOCKER = new ModuleType(1);
			ModuleType.LIFTER = new ModuleType(2);
			ModuleType.OHS = new ModuleType(3);
			ModuleType.OHT = new ModuleType(4);
			ModuleType.AGV = new ModuleType(5);
			ModuleType.PROCESS = new ModuleType(6);
			ModuleType.IT_ENUM_MAX = new ModuleType(2147483647);
			ModuleType.displayStrings[0] = "Device";
			ModuleType.displayStrings[1] = "Stocker";
			ModuleType.displayStrings[2] = "Lifter";
			ModuleType.displayStrings[3] = "OHS";
			ModuleType.displayStrings[4] = "OHT";
			ModuleType.displayStrings[5] = "AGV ";
			ModuleType.displayStrings[6] = "PROCESS ";
			ModuleType.displayValues[0] = ModuleType.DEVICE;
			ModuleType.displayValues[1] = ModuleType.STOCKER;
			ModuleType.displayValues[2] = ModuleType.LIFTER;
			ModuleType.displayValues[3] = ModuleType.OHS;
			ModuleType.displayValues[4] = ModuleType.OHT;
			ModuleType.displayValues[5] = ModuleType.AGV;
			ModuleType.displayValues[6] = ModuleType.PROCESS;
		}
		public static string ValueToString(ModuleType val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = ModuleType.displayStrings[0];
				return result;
			case 1:
				result = ModuleType.displayStrings[1];
				return result;
			case 2:
				result = ModuleType.displayStrings[2];
				return result;
			case 3:
				result = ModuleType.displayStrings[3];
				return result;
			case 4:
				result = ModuleType.displayStrings[4];
				return result;
			case 5:
				result = ModuleType.displayStrings[5];
				return result;
			}
			result = "";
			return result;
		}
		public static ModuleType StringToValue(string val)
		{
			ModuleType result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = ModuleType.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < ModuleType.displayStrings.Length; i++)
				{
					if (val.Equals(ModuleType.displayStrings[i]))
					{
						result = ModuleType.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static ModuleType From_Int(int value)
		{
			ModuleType result;
			if (value >= 0 && value < ModuleType._size)
			{
				result = ModuleType._array[value];
			}
			else
			{
				result = ModuleType.IT_ENUM_MAX;
			}
			return result;
		}
		protected ModuleType(int value)
		{
			this._value = value;
			if (value >= 0 && value < ModuleType._size)
			{
				ModuleType._array[this._value] = this;
			}
		}
		public bool Equals(ModuleType otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return ModuleType.displayStrings[this._value];
		}
	}
}
